package movieGandalf.GUI;

import movieGandalf.logicGuiConnection.User;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;


// This is the main Tab folder: Search, Me and Admin
public class MovieGandalfGUI extends CTabFolder {

        public MovieGandalfGUI(Composite parent, int style, User u) {
                super(parent, style);

                this.setLayout(new FillLayout());
                this.setTabHeight(25);
                this.setSimple(false);
                
                // Search tab
                CTabItem tbtmSearch = new CTabItem(this, SWT.NONE);
                tbtmSearch.setText("&Search");
                tbtmSearch.setControl(new SearchPage(this, SWT.NONE, u));

                // Me tab
                CTabItem Me = new CTabItem(this, SWT.NONE);
                Me.setText("&Me");
                Me.setControl(new MyPage(this, SWT.NONE, u));


                // Admin tab
                CTabItem tbtmDataMaintenance = new CTabItem(this, SWT.NONE);
                tbtmDataMaintenance.setText("&Admin");
                tbtmDataMaintenance.setControl(new AdminPage(this, SWT.NONE));
                
                this.setSelection(tbtmSearch);
        }
}